package com.epam.android.training.day4day5.task2;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Activity which shows list of cities in a list view with text filter support.
 * 
 * @author Anton Novikau
 */
public class CityListActivity extends ListActivity {

    /** Called when the activity is first created. */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.city,
                android.R.layout.simple_list_item_1);
        setListAdapter(adapter);
        ListView listView = getListView();
        listView.setTextFilterEnabled(true);
    }
}
